-- GENERATED SPELL FOR [Okrek] --


function spell0_18685(pUnit, Event) --@Demon Armor,Self--
pUnit:FullCastSpellOnTarget(13787,pUnit)
pUnit:RegisterEvent('Sorts_18685', 0, 1)
end

function spell1_18685(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(14034,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18685', 3000, 1)
end

function spell2_18685(pUnit, Event) --@Scorch,n/a--
pUnit:FullCastSpellOnTarget(38391,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18685', 1500, 1)
end

function spell3_18685(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(12471,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18685', 3000, 1)
end

function spell4_18685(pUnit, Event) --@Shadow Nova,Self--
pUnit:FullCastSpellOnTarget(32711,pUnit)
pUnit:RegisterEvent('Sorts_18685', 566, 1)
end

function Sorts_18685(pUnit, Event)
local choix_sorts_18685 = math.random(0, 4)
if choix_sorts_18685 == 0 then
pUnit:RegisterEvent('spell0_18685', 1, 1)
end
if choix_sorts_18685 == 1 then
pUnit:RegisterEvent('spell1_18685', 1, 1)
end
if choix_sorts_18685 == 2 then
pUnit:RegisterEvent('spell2_18685', 1, 1)
end
if choix_sorts_18685 == 3 then
pUnit:RegisterEvent('spell3_18685', 1, 1)
end
if choix_sorts_18685 == 4 then
pUnit:RegisterEvent('spell4_18685', 1, 1)
end
end

function mob18685_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18685', math.random(1500, 3000), 1)
end

function mob18685_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18685_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18685_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18685, 1, 'mob18685_Action')
RegisterUnitEvent(18685, 2, 'mob18685_Leave')
RegisterUnitEvent(18685, 3, 'mob18685_Kill')
RegisterUnitEvent(18685, 4, 'mob18685_Die')
